﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace _025
{
    public class Person
    {
        private string name;
        private int age;
        public Person(string n,int a)
        {
            name = n;
            age = a;
        }
    }
    public class Student
    {
        public int id;
        public string name;
        public string sex;
        public int age;
        public void insert(int i, string n, string s, int a)
        {
            id = i;
            name = n;
            sex = s;
            age = a;
        }
        public void Displays()
        {
            Console.WriteLine("编号：{0},姓名：{1},性别：{2},年龄：{3}",id,name,sex,age);
        }
            
    }
    struct Books
    {
        public string title;
        public string author;
        public string subject;
        public int book_id;

        public void Getvalue(string t,string a,string s,int id)
        {
            title = t;
            author = a;
            subject = s;
            book_id = id;
        }
        public void disPlay()
        {
            Console.WriteLine("title:{0},author:{1},subject:{2},book_id:{3}",title,author,subject,book_id);
        }
    }
    public class Students
    {
        private Students() { }
        public static int id;
        public static string name;
        public static void Displays()
        {
            Console.WriteLine("姓名:"+name+"编号:"+id);
        }
    }

    internal class Program
    {
        public static int num = 0;//构造函数
        Program()
        {
            num = 1;
        }
        static Program()
        {
            num = 2;
        }
        enum Day
        {
            Sun,Mon,Tue,Web,Thu,Fri,Sat
        };
        enum Season
        {
            winter=10,
            spring,
            summer=15,
            autumn
        };
        static void Main(string[] args)
        {
            Students.id = 105;
            Students.name = "王五";
            Students.Displays();
            Console.WriteLine("num={0}",num);
            Program Obj = new Program();
            Console.WriteLine("num={0}",num);
            Console.Read();
            Person P = new Person("张三", 19);
            Student stu1 = new Student();
            Student stu2 = new Student();
            stu1.insert(101, "张三", "男", 18);
            stu1.Displays();
            stu2.insert(102, "李四", "女", 19);
            stu2.Displays();
            foreach(Season i in Enum.GetValues(typeof(Season)))
            {
                Console.WriteLine("{0}={1}", i, (int)i);
            }
            foreach(string a in Enum.GetNames(typeof(Season)))
            {
                Console.WriteLine(a);
            }
            Console.WriteLine("Sun={0},Mon={1},Tue={2},Web={3},Thu={4},Fri={5},Sat={6}", (int)Day.Sun, (int)Day.Mon, (int)Day.Tue, (int)Day.Web, (int)Day.Thu, (int)Day.Fri, (int)Day.Sat); ;
            Books book1 = new Books();
            Books book2 = new Books();
            book1.Getvalue("语文", "数学", "英语", 123);
            book2.Getvalue("C#语言", "C语言", "Java语言", 234);
            book1.disPlay();
            book2.disPlay();
            Console.ReadKey();
        }
    }
}
